package com.joinway.framework.core.support;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.Cacheable;

import com.joinway.framework.bean.domain.constant.DomainConstants;
import com.joinway.framework.core.bean.domain.MonitorConfig;
import com.joinway.framework.data.jdbc.repository.TableRepository;

@Deprecated
public class PerformanceMonitoredMethodProvider {

	private static final String PERFORMANCE_TYPE = "1";
	private static final String MONITOR_CONFIG_CACHE = "MonitorConfig";
//	@Override
//	public boolean isTarget(ProceedingJoinPoint point) {
//		return false;
//	}
	
//	protected TableRepository repository;
//	
//	@Override
//	@Cacheable(value=MONITOR_CONFIG_CACHE)
//	public Map<String, MonitoredMethod> getMonitoredMethods() {
//		Map<String, MonitoredMethod> methods = new HashMap<>();
//
//		List<MonitorConfig> configs = repository.findAll(MonitorConfig.class);
//		
//		if(CollectionUtils.isNotEmpty(configs)){
//			for(MonitorConfig config : configs){
//				if(DomainConstants.YES.equalsIgnoreCase(config.getEnableFlag()) && PERFORMANCE_TYPE.equals(config.getMonitorType())){
//					MonitoredMethod mm = new MonitoredMethod();
//					mm.setMethodName(config.getMethodName());
//					
//					methods.put(config.getClassName() + "." + config.getMethodName(), mm);
//				}
//			}
//		}
//		
//		return methods;
//	}
//
//	public TableRepository getRepository() {
//		return repository;
//	}
//
//	public void setRepository(TableRepository repository) {
//		this.repository = repository;
//	}

}
